<?php
$loader->requireOnce('includes/Icd10Selector/Icd10Selector.class.php');
class C_Icd10 extends Controller {

	var $template_mod;
	var $icd;
	
	public function C_Icd10($template_mod = "general") {
		parent::Controller();          
    	if (Celini::getCurrentController() == 'Icd10') {
			$menu =& Menu::getInstance();
			$menu->currentSection = 'patient';
		}    
        $this->template_mod = $template_mod;
		$this->view->path 	= 'icd_10';
		$this->icd = new Icd10Selector();
	}
	
	public function actionGetGroupsAjax() {
		return $this->icd->getAllGroups('icd10Group', 'loadBlocks');
	}
	
    public function actionGetGroupsByChapterIdAjax() {
    	$chapterId = $_GET['icd10ChapterId'];
        return $this->icd->getGroupsByChapterId($chapterId, 'icd10Group', 'loadBlocks');
    }
    
	public function actionGetBlocksAjax() {
		return $this->icd->getBlocks('icd10Block', $_GET['groupId'], 'loadItems');
	}
	
	public function actionGetItemsAjax() {
		return $this->icd->getItems('icd10Item', $_GET['code'], 'getItem');
	}
}
?>